#ifndef _K_INI_FILE_
#define _K_INI_FILE_

namespace krt
{
	class KRUNTIME_CLASS CustomIniFile
	{
	public:
		CustomIniFile();

		virtual ~CustomIniFile();

		virtual BOOL SectionExists(const TCHAR* section) = 0;

		virtual BOOL KeyExists(
			const TCHAR* section,
			const TCHAR* key) = 0;

		virtual int ReadInteger(
			const TCHAR* section,
			const TCHAR* key,
			int _default) = 0;

		virtual TCHAR* ReadString(
			const TCHAR* section,
			const TCHAR* key,
			const TCHAR* _default,
			TCHAR *buf,
			size_t len) = 0;

		virtual double ReadFloat(
			const TCHAR* section,
			const TCHAR* key,
			double _default) = 0;
	};

	class KRUNTIME_CLASS SimpleIniFile: public CustomIniFile
	{
	private:

		TCHAR m_FileName[MAX_PATH];

	public:

		SimpleIniFile(const TCHAR *FileName);

		virtual ~SimpleIniFile();

		virtual BOOL SectionExists(const TCHAR* section);

		virtual BOOL KeyExists(
			const TCHAR* section,
			const TCHAR* key);

		virtual int ReadInteger(
			const TCHAR* section,
			const TCHAR* key,
			int _default);

		virtual TCHAR* ReadString(
			const TCHAR* section,
			const TCHAR* key,
			const TCHAR* _default,
			TCHAR *buf,
			size_t len);

		virtual double ReadFloat(
			const TCHAR* section,
			const TCHAR* key,
			double _default);
	};
}

#endif	//_K_INI_FILE_